package org.tigris.subversion.svnant.commands;

import java.io.File;
import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
import org.tigris.subversion.svnclientadapter.SVNClientException;

public class Add extends ResourceSetSvnCommand
{
  private static final String MSG_CANT_ADD_DIRECTORY = "Can't add directory '%s' to repository";
  private static final String MSG_CANT_ADD_FILE = "Can't add file '%s' to repository";
  private boolean force = false;

  public Add()
  {
    super(true, false, true, null);
  }

  protected void handleUnmanaged(File paramFile)
  {
    svnAddDir(paramFile, false, this.force);
  }

  protected void handleDir(File paramFile, boolean paramBoolean)
  {
    svnAddDir(paramFile, paramBoolean, this.force);
  }

  protected void handleFile(File paramFile)
  {
    svnAddFile(paramFile);
  }

  private void svnAddFile(File paramFile)
  {
    try
    {
      getClient().addFile(paramFile);
    }
    catch (SVNClientException localSVNClientException)
    {
      throw ex(localSVNClientException, "Can't add file '%s' to repository", new Object[] { paramFile });
    }
  }

  private void svnAddDir(File paramFile, boolean paramBoolean1, boolean paramBoolean2)
  {
    try
    {
      getClient().addDirectory(paramFile, paramBoolean1, paramBoolean2);
    }
    catch (SVNClientException localSVNClientException)
    {
      throw ex(localSVNClientException, "Can't add directory '%s' to repository", new Object[] { paramFile });
    }
  }

  public void setForce(boolean paramBoolean)
  {
    this.force = paramBoolean;
  }

  public void setRecurse(boolean paramBoolean)
  {
    super.setRecurse(paramBoolean);
  }
}

/* Location:           C:\Users\Administrator\Desktop\svnant.jar
 * Qualified Name:     org.tigris.subversion.svnant.commands.Add
 * JD-Core Version:    0.6.0
 */